package im.beans;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 分组和用户（好友关系映射，关系中保護其余属性）
 * @author 凯
 *
 */
@Entity
@Table(name = "t_IM_Classify_friends")
public class Classify_User {
	private long id;
	private String nick_name;
	private Classify classify;
	private User user;
	private long classifyID;
	private long userID;

	@Id
	@GeneratedValue
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getNick_name() {
		return nick_name;
	}

	public void setNick_name(String nick_name) {
		this.nick_name = nick_name;
	}

	@ManyToOne
	@JoinColumn(name = "classify_id")
	public Classify getClassify() {
		return classify;
	}

	public void setClassify(Classify classify) {
		this.classify = classify;
	}

	@ManyToOne
	@JoinColumn(name = "friend_id")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name="classify_id",insertable=false,updatable=false)
	public long getClassifyID() {
		return classifyID;
	}

	public void setClassifyID(long classifyID) {
		this.classifyID = classifyID;
	}

	@Column(name="friend_id",insertable=false,updatable=false)
	public long getUserID() {
		return userID;
	}

	public void setUserID(long userID) {
		this.userID = userID;
	}
	
}
